<?php 

$conn = "mysql:host=localhost;dbname=mail;charset=utf8";
$db = new PDO($conn, 'root', 'kof97');
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);	//禁用模拟预处理语句,保证sql语句不被php解析
$db->exec("set names utf8");

//error_reporting(E_ALL ^ E_NOTICE);